<template>
	<view class="xinpinshoufa_buttonImg">
		<view class="xinpinshoufa_buttonImg_image" v-for="item in chilGoodsList" :key="item.id" >
			<image :src="item.list_pic_url" mode="widthFix" @click="showdetail(item.id)"></image>
			<view class="xinpinshoufa_text">{{ item.name }}</view>
			<view class="xinpinshoufa_price">￥ {{ item.retail_price.toFixed(2) }} 元</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:['chilGoodsList'],
		mounted() {
			// console.log(this.chilGoodsList,11)
		},
		methods:{
			showdetail(id){
				// console.log("进来了",id.toString())
				this.$store.dispatch("goods/actionsGoods",id.toString())
			}
		}
	}
	
</script>

<style lang="scss">
.xinpinshoufa_buttonImg {
	padding: 20rpx;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	margin-top: 20rpx;

	.xinpinshoufa_buttonImg_image {
		height: 454rpx;
		width: 348rpx;
		text-align: center;

		image {
			width: 348rpx;
		}

		.xinpinshoufa_text {
			font-size: 26rpx;
			// height: 28rpx;
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;
		}

		.xinpinshoufa_price {
			height: 28rpx;
			font-size: 24rpx;
			color: darkred;
			margin-top: 10rpx;
			margin-bottom: 20rpx;
			padding-bottom: 20rpx;
		}
	}
}
</style>
